cmake_minimum_required(VERSION 3.10.2)
if(POLICY CMP0054)
    cmake_policy(SET CMP0054 NEW)
endif()
project(AEyeDistribution)

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
    set(CMAKE_BUILD_TYPE "Debug")
endif()
message("${CMAKE_BUILD_TYPE} Build")

set(NOT_MSVC $<NOT:$<CXX_COMPILER_ID:MSVC>>)
add_compile_options($<$<AND:${NOT_MSVC},$<CONFIG:DEBUG>>:-Og>)
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
    add_compile_definitions($<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
else()
    if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
        add_definitions(-DNOMINMAX)
    endif()
endif()

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)

find_package(AEyeSensorSDK PATHS sdk/sdk_lib/lib/cmake/libAEyeSensorSDK REQUIRED)
add_subdirectory(examples/aeyeSensorController)